home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / shared / snns / snnsv3_0.z / snnsv3_0 / SNNSv3.0 / configure < prev    next >
Text File  |  1993-03-25  |  12KB  |  414 lines

  1. #!/bin/csh
  2.  
  3. # ****************************************************************************
  4. #  FILE     : configure
  5. #  SHORTNAME: config
  6.  
  7. #  PURPOSE  : Shell scipt to create three make files
  8. #          1) kernel in the directory kernel/source
  9. #          2) X user interface in xgui/source
  10.  
  11. #  AUTHOR   : Tilman Sommer, Niels Mache, Ralf Huebner
  12. #  DATE     : 17.02.92
  13.  
  14. #  MODIFICATIONS : 
  15. #    01.02.91 lines 222-225, 241-256 inserted. (Thomas Korb)
  16. #    22.05.91 some cosmetic changes (A. Zell)
  17. #       25.06.91 line 165 -DSYSTEMV (-> compiler, setbuffer())
  18. #       28.11.91 changes for V1.4: new Makefiles, sun4 dir. renamed to sparc
  19. #                (N. Mache)
  20. #       17.12.91 changes for X11R4: new directory paths (R. Huebner)
  21. #    17.02.92 build all, build compiler commented out (A. Zell)
  22. #    25.02.92 changes for X11R5, installation of RS6000 (R. Huebner)
  23. #    03.03.92 query, if X11 Files not found (R. Huebner)
  24. #    23.03.93 update for version 3.0 (R. Huebner)
  25. #
  26. #             (c) 1991, 92 by SNNS-Group
  27. #             Institut fuer parallele und verteilte Hoechstleistungsrechner
  28. #             Universitaet Stuttgart
  29. # ****************************************************************************
  30.  
  31.  
  32.  
  33. echo "************************************************"
  34. echo "*                                              *"
  35. echo "*  SNNS  - Stuttgart Neural Network Simulator  *"
  36. echo "*                                              *"
  37. echo "*          Installation of Version 3.0         *"
  38. echo "*                                              *"
  39. echo "************************************************"
  40. echo ""
  41. echo " - for use with X11R4 or X11R5 and Athena Toolkit"
  42. echo " - needs ansi C-Compiler"
  43. echo " - monochrome and color/grayscale displays"
  44. echo " - on Sun 3, Sun 4 and SPARCstations, DecStations, RS6000," 
  45. echo "   HP 9000 series, 386-PC and (hopefully) other machines"
  46. echo " - It is possible to install SNNS for different types of"
  47. echo "   machines in the same directory."
  48. echo ""
  49. echo -n "Do you really want to create new makefiles? (y/n) [return] > "
  50. set confirm=$<
  51. switch ($confirm)
  52. case y:
  53.     breaksw
  54. default:
  55.     echo "EXIT: snns.make not changed."
  56.     exit 0
  57. endsw
  58. echo ""
  59. echo ""
  60.  
  61. if ( -e ./kernel/sources/Makefile) then
  62.     echo -n "kernel  : Copying current Makefile to Makefile.bak ... "
  63.     /bin/cp ./kernel/sources/Makefile ./kernel/sources/Makefile.bak
  64.     echo "Done."
  65. endif
  66. if ( -e ./xgui/sources/Makefile) then
  67.     echo -n "xgui    : Copying current Makefile to Makefile.bak ... "
  68.     /bin/cp ./xgui/sources/Makefile ./xgui/sources/Makefile.bak
  69.     echo "Done."
  70. endif
  71. if ( -e ./compiler/sources/Makefile) then
  72.     echo -n "compiler: Copying current Makefile to Makefile.bak ... "
  73.     /bin/cp ./compiler/sources/Makefile ./compiler/sources/Makefile.bak
  74.     echo "Done."
  75. endif
  76.  
  77.  
  78. cat ./configuration/header >! ./snns.make.tmp
  79. echo "# Created by `logname` at `date`" >> ./snns.make.tmp
  80. echo "" >> ./snns.make.tmp
  81. echo "# -- SNNS  Installation  Directories  &  Libraries --" >> ./snns.make.tmp
  82. echo "" 
  83. echo "For installation, we need the full path to your current directory"
  84. echo "but without auto-mount prefix (like /tmp_mnt/...)"
  85. echo "Current directory:"
  86. echo "        " $cwd
  87. echo -n "Is this your current directory without auto-mount prefix? (y/n) [return] > "
  88. set confirm=$<
  89. switch ($confirm)
  90. case n:
  91.     echo ""
  92.     echo "Please enter the FULL path of your current directory"
  93.     echo "but without auto-mount prefix."
  94.     echo -n "> "
  95.     set rootdir=$<
  96.     breaksw
  97. default:
  98.     set rootdir = `echo $cwd`
  99.     breaksw
  100. endsw
  101.  
  102. echo "SNNSDIR = $rootdir" >> ./snns.make.tmp
  103.  
  104.  
  105. echo ""
  106. echo "Installation directory:"
  107. echo -n "        " $rootdir
  108. echo "/<kernel,xgui>/bin/<dec,sun3,sun4,rs6000,hp9000>"
  109. echo -n "Do you want to change the installation directory ? (y/n) [return] > "
  110. set confirm=$<
  111. switch ($confirm)
  112. case y:
  113.     echo ""
  114.     echo "Please enter the FULL path of your new installation directory"
  115.     echo "but without auto-mount prefix."
  116.     echo -n "> "
  117.     set InstallDir=$<
  118.     breaksw
  119. default:
  120.     set InstallDir
  121.     breaksw
  122. endsw
  123.  
  124.  
  125. # machine #############################################
  126.  
  127. echo ""
  128. echo ""
  129. echo "Select your machine"
  130. echo "  [1] Sun 4 Series and SPARCstations"
  131. echo "  [2] Sun 3 "
  132. echo "  [3] Decstation"
  133. echo "  [4] RS 6000"
  134. echo "  [5] HP 9000"
  135. echo "  [6] PC 386 Unix (Linux)"
  136. echo "  [7] Other"
  137. echo -n "Enter number 1-7 > "
  138. set machine=$<
  139.  
  140. switch ($machine)
  141. case 1:
  142.     echo "MACHINE = sun4" >> ./snns.make.tmp
  143.     set ccflags = "-O"
  144.     set fpoptions = ""
  145.     set thismachine = "sparc"
  146.     set machinename = "Sparc Series"
  147.     breaksw
  148. case 2:
  149.     echo "MACHINE = sun3" >> ./snns.make.tmp
  150.     set ccflags = "-O"
  151.     set machinename = "Sun 3 Series"
  152.     set thismachine = "sun3"
  153.     echo ""
  154.     echo "Does your Sun 3 have a 68881 fpu ?"
  155.     echo -n "(y/n) [return] > "
  156.     set fpu=$<
  157.     switch ($fpu)
  158.     case n:
  159.         set fpoptions = "-fsingle"
  160.         breaksw
  161.     default:
  162.         set fpoptions = "-fsingle -f68881"
  163.         breaksw
  164.     endsw
  165.     breaksw
  166. case 3:
  167.     echo "MACHINE =  dec" >> ./snns.make.tmp
  168.     set ccflags = "-O2 -Olimit 3000 -Dconst=''"
  169.     set fpoptions = "-float"
  170.         set machinename = "Digital DecStation"
  171.     set thismachine = "dec"
  172.     breaksw
  173. case 4:
  174.     echo "MACHINE = RS6000" >> ./snns.make.tmp
  175.     set ccflags = "-O"
  176.     set fpoptions = "-float"
  177.     set machinename = "IBM Risc Station 6000"
  178.     set thismachine = "RS6000"
  179.     breaksw
  180. case 5:
  181.     echo "MACHINE = HP9000" >> ./snns.make.tmp
  182.     set ccflags = "-O +Obb3000 -Aa -D_HPUX_SOURCE"
  183.     set fpoptions = ""
  184.     set machinename = "Hewlett-Packard Series 9000"
  185.     set thismachine = "HP9000"
  186.     breaksw
  187. case 6:
  188.     echo "MACHINE = 386" >> ./snns.make.tmp
  189.     echo "ccflags = -O -DSYSTEMV" >> ./snns.make.tmp
  190.     set machinename = "PC System V/386"
  191.     set thismachine = "pc386"
  192.     breaksw
  193. default:
  194.     echo "MACHINE = other" >> ./snns.make.tmp
  195.     set machinename = "Unknown"
  196.     set thismachine = "other"
  197.     breaksw
  198. endsw
  199.  
  200.  
  201. echo "MACHINENAME= $thismachine" >> ./snns.make.tmp
  202.  
  203.  
  204. echo ""
  205. echo ""
  206.  
  207. # compiler ##########################################
  208.  
  209. echo -n "Do you want to use the GNU-C Compiler ? (y/n) [return] > "
  210. set use_gcc=$<
  211. if ( $use_gcc == y ) then
  212.   set compiler = gcc
  213.   set ccflags = "-O4 -ansi"
  214.   if ( $thismachine == dec ) then
  215.       set ccflags = ( $ccflags -fno-omit-frame-pointer -Dultrix)
  216.   endif
  217.   set fpoptions = ""
  218. else
  219.   set compiler = cc
  220. endif
  221.  
  222. echo "COMPILER = $compiler" >> ./snns.make.tmp
  223. echo "CCFLAGS = $ccflags" >> ./snns.make.tmp
  224. echo "FPOPTIONS = $fpoptions" >> ./snns.make.tmp
  225.  
  226.  
  227. echo ""
  228. echo ""
  229.  
  230. # libraries #############################################
  231.  
  232. set xlib = /usr/local/X11R5/lib
  233. while (! -e $xlib/libX11.a )
  234.     echo "X Libraries not found in $xlib"
  235.         echo "Please enter full path of the X11 libraries"
  236.     echo -n "> "
  237.         set xlib=$<
  238. end
  239. echo "X11 libraries located."
  240. echo "XDIR = $xlib" >> ./snns.make.tmp
  241.  
  242. # includes #############################################
  243.  
  244. echo ""
  245. set xh = /usr/local/X11R5/include
  246. while (! -d $xh )
  247.     echo "X11 include directory is not $xh"
  248.         echo "Please enter full path of the X11 include files"
  249.     echo -n "> "
  250.         set xh=$<
  251. end
  252. echo "X11 include directory located."
  253. echo "XH = $xh" >> ./snns.make.tmp
  254.  
  255.  
  256.  
  257. echo ""
  258. echo ""
  259. echo "************************************************"
  260. echo "*                                              *"
  261. echo "*  SNNS  - Stuttgart Neural Network Simulator  *"
  262. echo "*                                              *"
  263. echo "*             selected configuration           *"
  264. echo "*                                              *"
  265. echo "************************************************"
  266. echo ""
  267. echo "Machine: " $machinename
  268. echo ""
  269. echo "Compiler: " $compiler
  270. echo ""
  271. echo "SNNS sources in " 
  272. echo "  1)  $rootdir/kernel/sources"
  273. echo "  2)  $rootdir/xgui/sources"
  274. # echo "  3)  $rootdir/compiler/sources"
  275. echo ""
  276. echo "X Windows Version 11 Release 5 "
  277. echo "  libraries in                 " $xlib
  278. echo "  header file directory in     " $xh
  279. echo ""
  280. echo -n "Is this correct ? (y/n) [return] > "
  281. set confirm=$<
  282. switch ($confirm)
  283. case n:
  284.     echo "EXIT: snns.make unchanged."
  285.     /bin/rm -f ./snns.make.tmp
  286.     exit 0
  287. default:
  288.     echo ""
  289.     echo -n "Building makefiles ..."
  290.  
  291. # Kernel
  292.         set KERNELROOTDIR = $rootdir/kernel/sources
  293.         /bin/cp ./snns.make.tmp $KERNELROOTDIR/Makefile
  294.         cat $rootdir/configuration/kernelstuff >> $KERNELROOTDIR/Makefile
  295.     cat $rootdir/configuration/depend.kernel >> $KERNELROOTDIR/Makefile
  296.     chmod 744 $KERNELROOTDIR/Makefile
  297.     if (! -d $rootdir/kernel/bin/$thismachine) then
  298.       mkdir $rootdir/kernel/bin/$thismachine
  299.     endif
  300.     if ( $InstallDir != "" ) then
  301.       set bindir = $InstallDir
  302.       if (! -d $bindir)  then
  303.         mkdir $bindir
  304.       endif
  305.     else
  306.           set bindir = $rootdir/kernel/bin/$thismachine
  307.     endif
  308.     echo "s&____&$bindir&g" > $rootdir/configuration/Temp
  309.     sed -f $rootdir/configuration/Temp $KERNELROOTDIR/Makefile > $KERNELROOTDIR/m.new
  310.     /bin/mv  $KERNELROOTDIR/m.new $KERNELROOTDIR/Makefile
  311.     /bin/rm $rootdir/configuration/Temp
  312.     chmod 744 $KERNELROOTDIR/Makefile
  313.  
  314.  
  315.  
  316. # XGUI
  317.         set XGUIROOTDIR = $rootdir/xgui/sources
  318.         /bin/cp ./snns.make.tmp $rootdir/xgui/sources/Makefile
  319.         cat $rootdir/configuration/xguistuff >> $XGUIROOTDIR/Makefile
  320.     cat $rootdir/configuration/depend.xgui >> $XGUIROOTDIR/Makefile
  321.     if (! -d $rootdir/xgui/bin/$thismachine) then
  322.       mkdir $rootdir/xgui/bin/$thismachine
  323.     endif
  324.     if ( $InstallDir != "") then
  325.       set bindir = $InstallDir
  326.       if (! -d $bindir)  then
  327.         mkdir $bindir
  328.       endif
  329.       echo ""
  330.       echo -n "Copying xgui files: help.hdoc, default.cfg ..."
  331.       /bin/cp $rootdir/xgui/bin/help.hdoc   $InstallDir
  332.       /bin/cp $rootdir/xgui/bin/default.cfg $InstallDir
  333.       echo "Done."
  334.       echo ""
  335.     else
  336.           set bindir = $rootdir/xgui/bin/$thismachine
  337.     endif
  338.     echo "s&____&$bindir&g" > $rootdir/configuration/Temp
  339.     sed -f $rootdir/configuration/Temp $XGUIROOTDIR/Makefile > $XGUIROOTDIR/m.new
  340.     /bin/mv  $XGUIROOTDIR/m.new $XGUIROOTDIR/Makefile
  341.     /bin/rm $rootdir/configuration/Temp
  342.     chmod 744 $XGUIROOTDIR/Makefile
  343.  
  344. # Compiler
  345. #    set COMPILERROOTDIR = $rootdir/compiler/sources
  346. #        /bin/cp ./snns.make.tmp $rootdir/compiler/sources/Makefile
  347. #       cat $rootdir/configuration/compilerstuff >> $COMPILERROOTDIR/Makefile
  348. #    cat $rootdir/configuration/$thismachine.compiler >> $COMPILERROOTDIR/Makefile
  349. #    cat $rootdir/configuration/depend.compiler >> $COMPILERROOTDIR/Makefile
  350. #    if (! -d $rootdir/compiler/bin/$thismachine) then
  351. #      mkdir $rootdir/compiler/bin/$thismachine
  352. #    endif
  353. #    if ( $InstallDir != "") then
  354. #      set bindir = $InstallDir
  355. #      if (! -d $bindir)  then
  356. #        mkdir $bindir
  357. #      endif
  358. #    else
  359. #          set bindir = $rootdir/compiler/bin/$thismachine
  360. #    endif
  361. #    echo "s&____&$bindir&g" > $rootdir/configuration/Temp
  362. #    sed -f $rootdir/configuration/Temp $COMPILERROOTDIR/Makefile > $COMPILERROOTDIR/m.new
  363. #    /bin/mv  $COMPILERROOTDIR/m.new $COMPILERROOTDIR/Makefile
  364. #    /bin/rm $rootdir/configuration/Temp
  365. #    chmod 744 $COMPILERROOTDIR/Makefile
  366.  
  367.  
  368. # END
  369.     /bin/rm -f ./snns.make.tmp 
  370.     echo "Done."
  371.  
  372.  
  373.     echo ""
  374.     echo ""
  375.     echo "************************************************"
  376.     echo "*                                              *"
  377.     echo "*  SNNS  - Stuttgart Neural Network Simulator  *"
  378.     echo "*                                              *"
  379.     echo "************************************************"
  380.     echo ""
  381.     echo "If you start to build SNNS the first time for a new type"
  382.     echo "of machine then first delete all object files with the"
  383.     echo "command:"
  384.     echo "                ./cleanup all"
  385.     echo ""
  386.     echo "Then type:"
  387.     echo ""
  388. #    echo "./build all       - to build all SNNS modules"
  389.     echo "./build sim       - to build kernel and xgui"
  390.     echo "./build kernel    - to build kernel only"
  391.     echo "./build xgui      - to build xgui only"
  392. #    echo "./build compiler  - to build the Nessus compiler only"
  393.     echo ""
  394.     if ( $InstallDir != "" ) then
  395.         echo "SNNS will be placed in:"
  396.       echo "$InstallDir"
  397.       echo ""
  398.       echo "All libraries will be placed in:"
  399.     else
  400.       echo "All the relevant binaries will be placed in:"
  401.     endif
  402.     echo "$rootdir/(SNNS module)/bin"
  403.     echo ""
  404.     echo "All examples will be found in:"
  405.     echo "$rootdir/(SNNS module)/examples"
  406.     echo ""
  407.     echo "Remark: You can use ./cleanup with the same parameters"
  408.     echo "        used with the ./build program."
  409.     echo ""
  410.  
  411.     breaksw
  412. endsw
  413.  
  414.